/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistance.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author Bobok
 */
@Entity
@Table(name = "allowed_roles")
public class AllowedRole implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String role;
    @Column
    private String description;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (role != null ? role.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the role fields are not set
        if (!(object instanceof AllowedRole)) {
            return false;
        }
        AllowedRole other = (AllowedRole) object;
        if ((this.role == null && other.role != null) || (this.role != null && !this.role.equals(other.role))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistance.model.AllowedRoles[role=" + role + "]";
    }

}
